package fit.conceptmap.entities;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the conceptmaps database table.
 * 
 */
@Entity
@Table(name="conceptmaps")
@NamedQuery(name="Conceptmap.findAll", query="SELECT c FROM Conceptmap c")
public class Conceptmap implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String idConceptMaps;

	@Temporal(TemporalType.DATE)
	private Date dateCreate;

	private String description;

	@Temporal(TemporalType.TIMESTAMP)
	private Date endEdit;

	private String name;

	//bi-directional many-to-one association to Assignment
	@OneToMany(mappedBy="conceptmap")
	private List<Assignment> assignments;

	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="owner")
	private User user;

	//bi-directional many-to-one association to Relationship
	@OneToMany(mappedBy="conceptmap")
	private List<Relationship> relationships;

	//bi-directional many-to-one association to Share
	@OneToMany(mappedBy="conceptmap")
	private List<Share> shares;

	public Conceptmap() {
	}

	public String getIdConceptMaps() {
		return this.idConceptMaps;
	}

	public void setIdConceptMaps(String idConceptMaps) {
		this.idConceptMaps = idConceptMaps;
	}

	public Date getDateCreate() {
		return this.dateCreate;
	}

	public void setDateCreate(Date dateCreate) {
		this.dateCreate = dateCreate;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Date getEndEdit() {
		return this.endEdit;
	}

	public void setEndEdit(Date endEdit) {
		this.endEdit = endEdit;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<Assignment> getAssignments() {
		return this.assignments;
	}

	public void setAssignments(List<Assignment> assignments) {
		this.assignments = assignments;
	}

	public Assignment addAssignment(Assignment assignment) {
		getAssignments().add(assignment);
		assignment.setConceptmap(this);

		return assignment;
	}

	public Assignment removeAssignment(Assignment assignment) {
		getAssignments().remove(assignment);
		assignment.setConceptmap(null);

		return assignment;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public List<Relationship> getRelationships() {
		return this.relationships;
	}

	public void setRelationships(List<Relationship> relationships) {
		this.relationships = relationships;
	}

	public Relationship addRelationship(Relationship relationship) {
		getRelationships().add(relationship);
		relationship.setConceptmap(this);

		return relationship;
	}

	public Relationship removeRelationship(Relationship relationship) {
		getRelationships().remove(relationship);
		relationship.setConceptmap(null);

		return relationship;
	}

	public List<Share> getShares() {
		return this.shares;
	}

	public void setShares(List<Share> shares) {
		this.shares = shares;
	}

	public Share addShare(Share share) {
		getShares().add(share);
		share.setConceptmap(this);

		return share;
	}

	public Share removeShare(Share share) {
		getShares().remove(share);
		share.setConceptmap(null);

		return share;
	}

}